<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="box">
        {{obj.age}}
    </div>
    <script src='./vue.js'></script>
    <script>
        // const obj = {
        //     count: 100
        // }
        // document.querySelector('#box').innerHTML = obj.count;
        // setTimeout(() => {
        //     obj.count = 1000;
        // }, 1000)
        new Vue({
            data: {
                obj: {
                    count:100
                }
            },
            created() {
                // this.obj.age = 18
                // $set 添加一个响应式的数据
                this.$set(this.obj, 'age', 18)
                console.log(this.obj)
                setTimeout(() => {
                    this.obj.age = 20
                },1000)
            }
        }).$mount('#box')
        // $set
    </script>
</body>
</html>